﻿<Window x:Class="PlotterLayoutPanels.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
    Title="Window1" Height="400" Width="350">
    <Grid>
		<d3:ChartPlotter Name="plotter" Loaded="ChartPlotter_Loaded">
			<d3:ChartPlotter.Template>
				<ControlTemplate TargetType="{x:Type d3:Plotter}">
					<Grid Name="PART_ContentsGrid" Background="{TemplateBinding Background}" DataContext="{TemplateBinding DataContext}">
						<Grid.RowDefinitions>
							<RowDefinition Height="auto"/>
							<RowDefinition/>
							<RowDefinition Height="auto"/>
						</Grid.RowDefinitions>

						<StackPanel Name="PART_HeaderPanel" Orientation="Vertical" Grid.Row="0"/>

						<Grid Name="PART_MainGrid" Grid.Row="1">
							<Grid.RowDefinitions>
								<RowDefinition Height="auto"/>
								<RowDefinition/>
								<RowDefinition Height="auto"/>
							</Grid.RowDefinitions>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="auto"/>
								<ColumnDefinition/>
								<ColumnDefinition Width="auto"/>
							</Grid.ColumnDefinitions>

							<StackPanel Name="PART_LeftPanel" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" Background="Transparent"/>
							<StackPanel Name="PART_RightPanel" Grid.Column="2" Grid.Row="1" Orientation="Horizontal" Background="Transparent"/>
							<StackPanel Name="PART_BottomPanel" Grid.Column="1" Grid.Row="2" Orientation="Vertical" Background="Transparent"/>
							<StackPanel Name="PART_TopPanel" Grid.Column="1" Grid.Row="0" Orientation="Vertical" Background="Transparent"/>

							<!-- Border of viewport -->
							<Rectangle Name="Border" Grid.Column="1" Grid.Row="1" Stroke="{TemplateBinding BorderBrush}" 
									 StrokeThickness="{TemplateBinding BorderThickness}"/>

							<Grid Name="PART_CentralGrid" Grid.Column="1" Grid.Row="1" Background="Transparent">
								<Rectangle Stroke="DarkGray" StrokeThickness="3" RadiusX="4" RadiusY="4" Panel.ZIndex="1" Fill="#70FFFFA0">
									<Rectangle.RenderTransform>
										<TranslateTransform X="10" Y="10"/>
									</Rectangle.RenderTransform>
								</Rectangle>
								<Rectangle Stroke="Black" StrokeThickness="3" RadiusX="4" RadiusY="4" Panel.ZIndex="1" Fill="#50FFA0FF">
									<Rectangle.RenderTransform>
										<TranslateTransform X="30" Y="30"/>
									</Rectangle.RenderTransform>
								</Rectangle>
								<Canvas Panel.ZIndex="2">
									<TextBlock Text="CentralGrid" FontSize="12" Canvas.Top="12" Canvas.Left="14"/>
									<TextBlock Text="MainCanvas" FontSize="12" Canvas.Top="32" Canvas.Left="34"/>
								</Canvas>
							</Grid>
							<Canvas Name="PART_MainCanvas" Grid.Column="1" Grid.Row="1" ClipToBounds="True"/>

						</Grid>

						<Canvas Name="PART_ParallelCanvas" Grid.Column="1" Grid.Row="1"/>

						<StackPanel Name="PART_FooterPanel" Orientation="Vertical" Grid.Row="2"/>

						<Rectangle Stroke="DarkGray" StrokeThickness="3" Grid.RowSpan="3"/>
					</Grid>
				</ControlTemplate>
			</d3:ChartPlotter.Template>
			<d3:Header>HeaderPanel</d3:Header>

			<d3:HorizontalAxis Placement="Top"/>
			<d3:VerticalAxis Placement="Right"/>
			
			<d3:HorizontalAxisTitle Placement="Bottom">BottomPanel</d3:HorizontalAxisTitle>
			<d3:HorizontalAxisTitle Placement="Top">TopPanel</d3:HorizontalAxisTitle>
			<d3:VerticalAxisTitle Placement="Left">LeftPanel</d3:VerticalAxisTitle>
			<d3:VerticalAxisTitle Placement="Right">RightPanel</d3:VerticalAxisTitle>
			
			<d3:Footer>FooterPanel</d3:Footer>
		</d3:ChartPlotter>
	</Grid>
</Window>
